package org.jeecg.common.util;

import org.apache.commons.lang.StringUtils;

public enum DySmsEnum {

    LOGIN_TEMPLATE_CODE("SMS_176905339", "大医智慧", "code"),
    FORGET_PASSWORD_TEMPLATE_CODE("SMS_175435174", "大医智慧", "code"),
    CODE("SMS_176905339", "大医智慧", "code"),
    REGISTER_TEMPLATE_CODE("SMS_176905339", "大医智慧", "code"),
    DOCTOR_CERT_SUCCESS("SMS_202340129", "大医智慧", null),
    DOCTOR_CERT_FAIL("SMS_202350081", "大医智慧", null),
    SETTLEMENT("SMS_202566181","大医智慧","orderId,money"),
    NEW_ORDER("SMS_202350082", "大医智慧", null),
    WITHDRAW_SUCCESS("SMS_202345093", "大医智慧", "amout,receipt,tax"),
    REFUND("","大医智慧","orderId,amount"),
    // 挂号短信成功通知
    REGISTER_NOTICE("SMS_211496538","大医智慧","name_1,hospital_ment,name_title,date_part,num,hospital_2,phone_1"),
    // 挂号短信失败通知
    REGISTER_FAIL_NOTICE("SMS_211491693","大医智慧","name,hospital_department,doctor,date_part,phone_2"),
    // 患者挂号运营人员短信通知
    REGISTER_OPERATE_NOTICE("SMS_212691088","大医智慧","name_1,hospital_ment,name_title,date_part,num,patient_p"),
    // 患者挂号运营人员取消预约短信通知
    REGISTER_CANCEL_OPERATE_NOTICE("SMS_248500062","大医智慧","name_1,hospital_ment,name_title,date_part,num,patient_p");

    /**
     * 短信模板编码
     */
    private String templateCode;
    /**
     * 签名
     */
    private String signName;
    /**
     * 短信模板必需的数据名称，多个key以逗号分隔，此处配置作为校验
     */
    private String keys;

    private DySmsEnum(String templateCode, String signName, String keys) {
        this.templateCode = templateCode;
        this.signName = signName;
        this.keys = keys;
    }

    public String getTemplateCode() {
        return templateCode;
    }

    public void setTemplateCode(String templateCode) {
        this.templateCode = templateCode;
    }

    public String getSignName() {
        return signName;
    }

    public void setSignName(String signName) {
        this.signName = signName;
    }

    public String getKeys() {
        return keys;
    }

    public void setKeys(String keys) {
        this.keys = keys;
    }

    public static DySmsEnum toEnum(String templateCode) {
        if (StringUtils.isEmpty(templateCode)) {
            return null;
        }
        for (DySmsEnum item : DySmsEnum.values()) {
            if (item.getTemplateCode().equals(templateCode)) {
                return item;
            }
        }
        return null;
    }
}

